import { Component, OnInit } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
import { GitAuth } from '@api/git';
import { GitManagerService } from '@common/services/git/gitmanager';

@Component({
  selector: 'kd-auth-dialog',
  templateUrl: './auth-dialog.component.html',
  styleUrls: ['./auth-dialog.component.scss']
})
export class AuthDialogComponent implements OnInit {
  newconfig : GitAuth={
    id: 0,
    username: "",
    password: ""
  }
  constructor(private readonly gits :GitManagerService,
    public dialogRef: MatDialogRef<AuthDialogComponent>) {}
  AddNew(){
    this.gits.createGitAuth(this.newconfig).subscribe(
      data => console.log(data)
    )
  }
  ngOnInit(): void {
  }
  onNoClick(){
    this.dialogRef.close();
  }
}
